/*
 * @Descripttion: 胡腾辉 | feico
 * @version: V1.0
 * @Author: feico
 * @Date: 2022-02-20 11:48:45
 * @LastEditors: feico
 * @LastEditTime: 2022-02-22 12:52:22
 */
import { getToken } from '../../utils'
import { LOGIN_LOGIN,LOGOUT } from '../constants'
const initState={
    token:getToken()
}
export default function login(state=initState,action){
    switch (action.type) {
        case LOGIN_LOGIN:
            return {
                ...state,
                token:action.token
            }
            case LOGOUT:
                return {
                    ...state,
                    token:''
                }
        default:
            return state
    }
}
